package com.sanqing.factory;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

import com.sanqing.bean.Course;
import com.sanqing.bean.CourseName;
import com.sanqing.bean.Employee;
import com.sanqing.bean.Message;
import com.sanqing.bean.Reply;
import com.sanqing.dao.CourseDAO;
import com.sanqing.dao.EmployeeDAO;
import com.sanqing.dao.MessageDAO;
import com.sanqing.dao.ReplyDAO;

public class Text {
	public static void main(String[] args) {
		//测试消息模块
		
		String title="世界为何如此";
		String content="因为世界由你和我构造而成，我们很快乐";
		Message message=new Message();
		message.setMessageID(2);
		message.setMessageTitle(title);
		message.setMessageContent(content);
		//message.setPublishTime(new Date());
		
		MessageDAO messageDAO=MessageDAOFactory.getMessageDAOInstance();
		//messageDAO.addMessage(message);
		messageDAO.deleteMessage(25);
		
		
		//测试回复模块
//		Reply reply=new Reply();
//		reply.setReplyContent("你真惨哈哈哈");
//		reply.setEmployeeID(201703356);
//		reply.setMessageID(1);
//		reply.setReplyTime(new Date());
//		ReplyDAO replyDAO=ReplyDAOFactory.getReplyDAOInstance();
//		replyDAO.addReply(reply);
		
		//测试员工模块
//		Calendar calendar=Calendar.getInstance();
//		calendar.set(2006,12,12);//这里2006代表2007年 12代表1月
//		Calendar calendar1=Calendar.getInstance();
//		calendar1.set(2017, 12, 12);
//		
//		Employee employee=new Employee();
//		employee.setEmployeeID(201703357);
//		employee.setEmployeeName("严牧之");
//		employee.setEmployeeSex(false);
//		employee.setEmployeeBirth(calendar.getTime());
//		employee.setEmployeePhone("13789963356");  
//		employee.setEmployeePlace("国道口");
//		employee.setJoinTime(calendar1.getTime());
//		employee.setPassword("13789963356");
//		employee.setLead(true);
//		
//		EmployeeDAO employeeDAO=EmployeeDAOFactory.getEmployeeDAOInstance();
//		List<Employee> employees=employeeDAO.findAllEmployee();
//		
//		Employee employee1=employees.get(0);
//		System.out.println(employee1.getEmployeeName());
		
		//课程模块测试
		CourseDAO courseDAO=CourseDAOFactory.getCourseDAOInstance();
		Course course=courseDAO.findCourse(201703356);
		String test=course.getCoureseContent().substring(4);
		
		System.out.println(test);
		
		
		
	}
	
	public void ChangeFunction(CourseName day,String Message)
	{
		
	switch(Message.charAt(0))
	{
	 case '1':
		 day.setFirst("语文");
		 break;
	 case '2':
		 day.setFirst("数学");
		 break;
	 case '3':
		 day.setFirst("生物");
		 break;
	 case '4':
		 day.setFirst("地理");
		 break;
	 case '5':
		 day.setFirst("历史");
		 break;
	 case '6':
		 day.setFirst("物理");
		 break;
	 case '7':
		 day.setFirst("化学");
		 break;
	 case '8':
		 day.setFirst("体育");
		 break;
	 case '9':
		 day.setFirst("英语");
		 break;
		 
     default: break;
	}
	switch(Message.charAt(1))
	{
	 case '1':
		 day.setSecond("语文");
		 break;
	 case '2':
		 day.setSecond("数学");
		 break;
	 case '3':
		 day.setSecond("生物");
		 break;
	 case '4':
		 day.setSecond("地理");
		 break;
	 case '5':
		 day.setSecond("历史");
		 break;
	 case '6':
		 day.setSecond("物理");
		 break;
	 case '7':
		 day.setSecond("化学");
		 break;
	 case '8':
		 day.setSecond("体育");
		 break;
	 case '9':
		 day.setSecond("英语");
		 break;
		 
     default: break;
	}
	switch(Message.charAt(2))
	{
	 case '1':
		 day.setThrid("语文");
		 break;
	 case '2':
		 day.setThrid("数学");
		 break;
	 case '3':
		 day.setThrid("生物");
		 break;
	 case '4':
		 day.setThrid("地理");
		 break;
	 case '5':
		 day.setThrid("历史");
		 break;
	 case '6':
		 day.setThrid("物理");
		 break;
	 case '7':
		 day.setThrid("化学");
		 break;
	 case '8':
		 day.setThrid("体育");
		 break;
	 case '9':
		 day.setThrid("英语");
		 break;
		 
     default: break;
	}
	switch(Message.charAt(3))
	{
	 case '1':
		 day.setFourth("语文");
		 break;
	 case '2':
		 day.setFourth("数学");
		 break;
	 case '3':
		 day.setFourth("生物");
		 break;
	 case '4':
		 day.setFourth("地理");
		 break;
	 case '5':
		 day.setFourth("历史");
		 break;
	 case '6':
		 day.setFourth("物理");
		 break;
	 case '7':
		 day.setFourth("化学");
		 break;
	 case '8':
		 day.setFourth("体育");
		 break;
	 case '9':
		 day.setFourth("英语");
		 break;
		 
     default: break;
	}
	
	
	}
	

}
